
import { Link } from "@/types/content/link";
import { get, post, put, remove } from "@/utils/request";
/**
 * 查询全部外链
 * @returns
 */
export const queryLinkList = () =>get<Link.Row[]>(`/link/list`);

/**
 * 查询某一外链
 * @returns
 */
export const queryLinkInfo = (id: string)=>get<Link.Row>(`/link/${id}`);
/**
 * 添加外链
 * @returns
 */
export const addLink = (data: Link.Form) =>post(`/link/add`,data);
/**
 * 修改外链
 * @returns
 */
export const updateLink = (data: Link.Form) =>put(`/link/update`,data);
/**
 * 删除外链
 * @returns
 */
export const deleteLinkById = (id: string) =>remove(`/link/${id}`);
